# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_Campaign_ShoppingSetting do
  @moduledoc """
  The setting for Shopping campaigns. Defines the universe of products that can be advertised by the campaign, and how this campaign interacts with other Shopping campaigns.

  ## Attributes

  *   `campaignPriority` (*type:* `integer()`, *default:* `nil`) - Priority of the campaign. Campaigns with numerically higher priorities take precedence over those with lower priorities. This field is required for Shopping campaigns, with values between 0 and 2, inclusive. This field is optional for Smart Shopping campaigns, but must be equal to 3 if set.
  *   `enableLocal` (*type:* `boolean()`, *default:* `nil`) - Whether to include local products.
  *   `feedLabel` (*type:* `String.t`, *default:* `nil`) - Feed label of products to include in the campaign. Only one of feed_label or sales_country can be set. If used instead of sales_country, the feed_label field accepts country codes in the same format for example: 'XX'. Otherwise can be any string used for feed label in Google Merchant Center.
  *   `merchantId` (*type:* `String.t`, *default:* `nil`) - Immutable. ID of the Merchant Center account. This field is required for create operations. This field is immutable for Shopping campaigns.
  *   `salesCountry` (*type:* `String.t`, *default:* `nil`) - Sales country of products to include in the campaign. 
  *   `useVehicleInventory` (*type:* `boolean()`, *default:* `nil`) - Immutable. Whether to target Vehicle Listing inventory.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :campaignPriority => integer() | nil,
          :enableLocal => boolean() | nil,
          :feedLabel => String.t() | nil,
          :merchantId => String.t() | nil,
          :salesCountry => String.t() | nil,
          :useVehicleInventory => boolean() | nil
        }

  field(:campaignPriority)
  field(:enableLocal)
  field(:feedLabel)
  field(:merchantId)
  field(:salesCountry)
  field(:useVehicleInventory)
end

defimpl Poison.Decoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_Campaign_ShoppingSetting do
  def decode(value, options) do
    GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_Campaign_ShoppingSetting.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_Campaign_ShoppingSetting do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
